function createSlice({name,initialState,reducers}){

}
const counterSlice = createSlice({
    name:'counter',
    initialState:{number:0},
    reducers:{
        add:(state,action)=>{
            state.number+=1;
        }
    }
});
const actions = todosSlice.actions;
const actions2 = {//actionCreators
    add(payload){
        return {type:'counter/add',payload};//action
    }
}

const counterReducer = todosSlice.reducer;
function counterReducer(state,action){
    if(action.type === 'counter/add'){
        state.number+=1;
        return state;
    }
    return state;
}
